package com.heima.model.comment.pojos;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * @author y
 * 文章评论实体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(value = "comment")
public class Comment implements Serializable {

    private static final long serialVersionUID = -6775127224361158952L;

    /**
     * 主键id 自动生成
     */
    private String id;

    /**
     * 文章id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long entryId;

    /**
     * 评论人id
     */
    private Long authorId;

    /**
     * 评论人名字
     */
    private String authorName;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 评论点赞数
     */
    private Integer likes;

    /**
     * 评论回复数
     */
    private Integer reply;

    /**
     * 评论时间 毫秒值
     */
    private Long createdTime;

    /**
     * 用户头像
     */
    private String image;
}

